document.getElementsByTagName('span').className = 's1';
var add = document.querySelector("#add");
add.addEventListener("click",function () {
    var ipt = document.querySelector("#ipt");
    console.log(ipt.value);
    //获取input里面的内容
    var li =document.createElement('li');
    //创建li标签
    var span = document.createElement('span');
    var spantext = document.createTextNode(ipt.value);
    span.appendChild(spantext);
    span.addEventListener("click",function () {
        span.setAttribute("contentEditable",true)
    })
    //创建span标签
    var button = document.createElement('button');
    var buttontext =document.createTextNode('×');
    button.addEventListener("click",function () {
        var list =document.querySelector("#list");
        list.removeChild(button.parentNode)
    });
    button.appendChild(buttontext);
    //创建button标签
    li.appendChild(span);
    li.appendChild(button);
    console.log(li);
    console.log(span);
    console.log(button);
    var t =document.querySelector("#list");
    t.appendChild(li)
});

//选项卡
var nav = document.querySelectorAll(".nav >a");
var main = document.querySelectorAll(".main >a");
for( var i=0; i<nav.length;i++){
    nav[i].index =i;
    nav[i].addEventListener('mouseover',function () {
        for( var k=0;k<nav.length;k++){
            nav[k].classList.remove("active");
            main[k].classList.remove("active")
        }
        this.classList.add("active");
        console.log(this.index);
        main[this.index].classList.add("active")
    })
}